#ifndef _MANAGER_H_
#define _MANAGER_H_

#include "../identifier/Identifier.h"

class Manager
{
	private : 
		//vector of registered resources registered with the manager.
		Vector<Resource*> resources;
		//vector of Owners who own the resources currently
		Vector<Owner*> owners;
		//vector of requestors who are requesting the resource
		Vector<Vector<Owner*>> requestors;
		//vector of states of requests
		Vector<Vector<unsigned char>> requestorStates;
		//gets the resource index
		unsigned int getResourceIndex(Resource* id);
		//gets the resource index.
		unsigned int getResourceIndex(unsigned int id, bool idOrCode);

	public :
		//default constructor
		Manager(){}
		//registers a resource by the identifier
		Resource* registerResource(Resource* id);
		//get identifier by id
		Resource* getResourceById(unsigned int id);
		//ged identifier by code.
		Resource* getIdentifierByCode(unsigned int code);
		//get requestors by id
		Vector<Owner*>* getRequestorsById(unsigned int id);
		//get requestors by code
		Vector<Owner*>* getRequestorsByCode(unsigned int code);
		//get requestor states by id
		Vector<Vector<unsigned char>>* getStatesById(
							unsigned int id);
		//get requestor states by code
		Vector<unsigned char>* getStatesByCode(
							unsigned int code);
		//registers a new requestor
		Vector<Owner*>* registerRequestor(Resource* resource,
							Owner* requestor);

};



#endif
